<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>then 方法 catch</title>
</head>
<body>
    <script>
        //实例化promise 对象
        let p = new Promise((resolve, reject) => {
            //
            // resolve('OK');
            // reject('error');
        });

        //指定回调函数, 处理结果值
        p.then(value => {
            console.log(value);
        }, reason => {
            console.error(reason);
        });


    </script>
</body>
</html>